﻿<UserControl x:Class="Cratos.Generator.ProjectView"
						 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
						 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
						 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
						 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
						 xmlns:local="clr-namespace:Cratos.Generator"
						 mc:Ignorable="d" 
						 MinWidth="800" MinHeight="600">
	
	<UserControl.CommandBindings>
		<CommandBinding Command="{x:Static local:ProjectView.CloseCommand}" Executed="OnCloseCommand" />
	</UserControl.CommandBindings>

	<DockPanel>
		<Border DockPanel.Dock="Top" Style="{StaticResource header}">
			<DockPanel LastChildFill="False">
				<TextBlock x:Name="m_ProjectTitle" DockPanel.Dock="Left" Text="{Binding Path=Project.Name, Mode=TwoWay}" />
				
				<Button Style="{StaticResource crudButton}" DockPanel.Dock="Right"
								Command="{x:Static local:ProjectView.CloseCommand}">
					<StackPanel Orientation="Horizontal">
						<Image Source="../Images/cross.png" Margin="0 1 1 0" Height="20" />
					</StackPanel>
				</Button>
			</DockPanel>
		</Border>

		<Border x:Name="m_BorderProgress" DockPanel.Dock="Bottom" Visibility="Hidden"
								Background="{StaticResource lightBlueBrush}" Style="{StaticResource groupBoxHeader}">
			<TextBlock x:Name="m_LblProgress" HorizontalAlignment="Center" VerticalAlignment="Center" 
								 Visibility="Hidden" Text="Progress" />
		</Border>

		<Expander x:Name="m_ProjectExpander" DockPanel.Dock="Left" ExpandDirection="Right" IsExpanded="True"
							BorderThickness="0 1 1 1" BorderBrush="Gray" Margin="0 2 0 0" Padding="2" MaxWidth="400">
			<Expander.Header>
				<TextBlock Text="Project Details" FontSize="14" FontWeight="Bold">
					<TextBlock.LayoutTransform>
						<RotateTransform Angle="90"/>
					</TextBlock.LayoutTransform>
				</TextBlock>
			</Expander.Header>
	
			<StackPanel>
				<local:CratosProjectView x:Name="m_ProjectView" DockPanel.Dock="Top" />
			</StackPanel>
				
			
			<!--<DockPanel>
				
				<StackPanel DockPanel.Dock="Top" Style="{StaticResource buttonPanel}">
					<Button Style="{StaticResource crudButton}" DockPanel.Dock="Right"
									Command="{x:Static local:ProjectView.NewProjectCommand}" IsEnabled="{Binding CanCreate}">
						<StackPanel Orientation="Horizontal">
							<Image Source="../Images/add.png" Margin="0 1 1 0" Height="20" />
							<TextBlock Text="New Project" Margin="0 1" Padding="2" FontWeight="Bold" />
						</StackPanel>
					</Button>

					<Button Style="{StaticResource crudButton}" DockPanel.Dock="Right"
									Command="{x:Static local:ProjectView.SaveProjectCommand}">
						<StackPanel Orientation="Horizontal">
							<Image Source="../Images/Save.png" Margin="0 1 1 0" Height="20" />
							<TextBlock Text="Save Project" Margin="0 1" Padding="2" FontWeight="Bold" />
						</StackPanel>
					</Button>
				</StackPanel>

				<GroupBox BorderBrush="{StaticResource lightBlueBrush}" DockPanel.Dock="Top"
									VerticalAlignment="Top" HorizontalAlignment="Left">
					<GroupBox.Header>
						<Border Background="{StaticResource lightBlueBrush}" Style="{StaticResource groupBoxHeader}">
							<TextBlock Text="Project Name" />
						</Border>
					</GroupBox.Header>
				
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="200" />
						</Grid.ColumnDefinitions>

						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition Height="Auto" />
						</Grid.RowDefinitions>

						<TextBox x:Name="m_TxtProjectName" Grid.Row="0" Grid.Column="1" Width="200"
										 Text="{Binding Path=Project.Name, Mode=TwoWay}" IsEnabled="{Binding IsInEdit}"/>
					</Grid>
				</GroupBox>

				<GroupBox BorderBrush="{StaticResource lightBlueBrush}" DockPanel.Dock="Top"
									VerticalAlignment="Top" HorizontalAlignment="Left">
					<GroupBox.Header>
						<Border Background="{StaticResource lightBlueBrush}" Style="{StaticResource groupBoxHeader}">
							<TextBlock Text="Project Modules" />
						</Border>
					</GroupBox.Header>

					<ListView x:Name="m_ListModules" Grid.Row="0" Margin="5">
						<ListView.View>
							<GridView>
								<GridViewColumn Header="Name" Width="180" DisplayMemberBinding="{Binding Name}"/>
							</GridView>
						</ListView.View>
					</ListView>
				</GroupBox>
			</DockPanel>-->		
		</Expander>
		
		<Expander x:Name="m_VersionExpander" DockPanel.Dock="Top" ExpandDirection="Down" IsExpanded="True"
							BorderThickness="0 1 1 1" BorderBrush="Gray" Margin="0 2 0 0" Padding="2">
			<Expander.Header>
				<TextBlock Text="Versions" FontSize="14" FontWeight="Bold" />
			</Expander.Header>

			<ListView x:Name="m_ListVersions" Grid.Row="0" Margin="5">
				<ListView.View>
					<GridView>
						<GridViewColumn Header="Version" DisplayMemberBinding="{Binding LogonName}"/>
						<GridViewColumn Header="Class Namespace" DisplayMemberBinding="{Binding Person.Name}"/>
						<GridViewColumn Header="Test Namespace" DisplayMemberBinding="{Binding UserStatus.Name}"/>
					</GridView>
				</ListView.View>
			</ListView>
		</Expander>

		<TabControl x:Name="m_ProjectTabControl" Margin="5 0">
			<TabItem Header="Model"></TabItem>
			<TabItem Header="Schema"></TabItem>
		</TabControl>
	</DockPanel>
</UserControl>
